<template>
	<div class="card">
		<div class="phone-content">
			<!-- 手机号微信号 -->
			<div class="avatar">
				<image v-if="message.messageContent.extra == 'phone'" style="width: 100%; height: 100%;" src="../../phone.png" alt=""  mode="scaleToFill"/>
				<image v-else style="width: 100%; height: 100%;" src="../../wx.png" alt=""  mode="scaleToFill"/>
			</div>
			<div class="info-content">
				<div class="phone-content-title">
					{{JSON.parse(message.messageContent.content).realName}}的{{
		          message.messageContent.extra == "phone"
		            ? "手机号"
		            : "微信号"
		        }}：
				</div>
				<div class="phone-content-message">
					{{ JSON.parse(message.messageContent.content)[message.messageContent.extra == "phone"?'phone':'wechatNumber']  }}
				</div>
			</div>
			<div class="phone-button" @click="makeCall" v-if="message.messageContent.extra == 'phone'">
				拨号
			</div>
		</div>
	</div>
</template>

<script>
	import {
		getJobContact,
		getInteractionDic,
		setImInteraction,
	} from "@/common/im";

	export default {
		name: "NormalInMessageContentView",
		props: {
			message: null,
		},
		data() {
			return {
			};
		},
		methods: {
			// 拨打电话
			makeCall() {
				uni.makePhoneCall({
					phoneNumber: this.message.messageContent.content, // 要拨打的电话号码
					success() {
						console.log("拨号成功");
					},
					fail(err) {
						console.log("拨号失败", err);
					},
				});
			},
			
		},
	};
</script>

<style scoped>
	.info-content {
		margin-right: 16rpx;
	}
</style>